Műsortár
$get_show = $_GET['show']; $get_place = $_GET['place']; $get_keyword = mb_strtolower($_GET['keyword'],"UTF-8"); /*echo "Show= ".$get_show; echo ""; echo "Place= ".$get_place; echo "
"; echo "Keyword= ".$get_keyword; echo "
";*/ /*No filter*/ if ($get_show==0 AND $get_place==0 AND $get_keyword=="") { $select_search = mysql_query("SELECT videos.supplier, shows.name, videos.duration, videos.video_id, videos.thumbnail FROM videos JOIN shows ON (videos.show_id=shows.id) ORDER BY videos.upload_date;"); //INNER JOIN shows ON (videos.show_id=show.id) } /*Filter only for show*/ if ($get_show!=0 AND $get_place==0 AND $get_keyword=="") { $select_search = mysql_query("SELECT videos.supplier, shows.name, videos.duration, videos.video_id, videos.thumbnail FROM videos JOIN shows ON (videos.show_id=shows.id) WHERE videos.show_id=$get_show ORDER BY videos.upload_date;"); } /*Filter only for place*/ if ($get_show==0 AND $get_place!=0 AND $get_keyword=="") { $select_search = mysql_query("SELECT videos.supplier, shows.name, videos.duration, videos.video_id, videos.thumbnail FROM videos JOIN shows ON (videos.show_id=shows.id) JOIN counties ON (videos.county=counties.id) WHERE videos.county=$get_place ORDER BY videos.upload_date;"); } /*Filter only for keyword*/ if ($get_show==0 AND $get_place==0 AND $get_keyword!="") { $get_keyword="'%".$get_keyword."%'"; $select_search = mysql_query("SELECT videos.supplier, shows.name, videos.duration, videos.video_id, videos.thumbnail FROM videos JOIN shows ON (videos.show_id=shows.id) WHERE lower(videos.title) LIKE $get_keyword OR lower(videos.description) LIKE $get_keyword OR lower(videos.keywords) LIKE $get_keyword OR lower(videos.supplier) LIKE $get_keyword ORDER BY videos.upload_date;"); } /*Filter only for show and place*/ if ($get_show!=0 AND $get_place!=0 AND $get_keyword=="") { $select_search = mysql_query("SELECT videos.supplier, shows.name, videos.duration, videos.video_id, videos.thumbnail FROM videos JOIN shows ON (videos.show_id=shows.id) JOIN counties ON (videos.county=counties.id) WHERE videos.show_id=$get_show AND videos.county=$get_place ORDER BY videos.upload_date;"); } /*Filter only for show and keyword*/ if ($get_show!=0 AND $get_place==0 AND $get_keyword!="") { $get_keyword="'%".$get_keyword."%'"; $select_search = mysql_query("SELECT videos.supplier, shows.name, videos.duration, videos.video_id, videos.thumbnail FROM videos JOIN shows ON (videos.show_id=shows.id) WHERE (videos.show_id=$get_show) AND (lower(videos.title) LIKE $get_keyword OR lower(videos.description) LIKE $get_keyword OR lower(videos.keywords) LIKE $get_keyword OR lower(videos.supplier) LIKE $get_keyword) ORDER BY videos.upload_date;"); } /*Filter only for place and keyword*/ if ($get_show==0 AND $get_place!=0 AND $get_keyword!="") { $get_keyword="'%".$get_keyword."%'"; $select_search = mysql_query("SELECT videos.supplier, shows.name, videos.duration, videos.video_id, videos.thumbnail FROM videos JOIN shows ON (videos.show_id=shows.id) JOIN counties ON (videos.county=counties.id) WHERE (videos.county=$get_place) AND (lower(videos.title) LIKE $get_keyword OR lower(videos.description) LIKE $get_keyword OR lower(videos.keywords) LIKE $get_keyword OR lower(videos.supplier) LIKE $get_keyword) ORDER BY videos.upload_date;"); } /*Filter for everything*/ if ($get_show!=0 AND $get_place!=0 AND $get_keyword!="") { $get_keyword="'%".$get_keyword."%'"; $select_search = mysql_query("SELECT videos.supplier, shows.name, videos.duration, videos.video_id, videos.thumbnail FROM videos JOIN shows ON (videos.show_id=shows.id) JOIN counties ON (videos.county=counties.id) WHERE (videos.show_id=$get_show) AND (videos.county=$get_place) AND (lower(videos.title) LIKE $get_keyword OR lower(videos.description) LIKE $get_keyword OR lower(videos.keywords) LIKE $get_keyword OR lower(videos.supplier) LIKE $get_keyword) ORDER BY videos.upload_date;"); } /*while($row_search = mysql_fetch_array($select_search)) { echo "Szolgáltató: ".$row_search[0]."
"; echo "Műsor: ".$row_search[1]."
"; echo "Hossz: ".$row_search[2]."
"; echo "Video ID: ".$row_search[3]."
"; echo "Thumbnail: ".$row_search[4]."
"; }*/ ?>
Találati eredmény
if ($get_show==0 AND $get_place==0 AND $get_keyword==""){
echo "| Összes videó |";
} else{
echo "| ";
if ($get_show!=0){
$select_show = mysql_query("SELECT * FROM shows WHERE id=$get_show");
$selected_show = mysql_fetch_array($select_show);
echo $selected_show['name'];
}
if ($get_place!=0){
if ($get_show!=0) echo " | ";
$select_place = mysql_query("SELECT * FROM counties WHERE id=$get_place");
$selected_place = mysql_fetch_array($select_place);
echo $selected_place['name'];
}
if ($get_keyword!=""){
if ($get_show!=0 OR $get_place!=0) echo " | ";
echo str_replace('%','', $get_keyword);
}
echo " | ";
}
?>
echo "
"; echo " | ";
echo " ";
echo "".$row_search[0]." |